package com.ease.model.criterion;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.ease.common.util.Detect;
import com.ease.common.vo.Entry;

/**
 * 
 * @author nathanleewei
 * 
 */
public abstract class CriterionSupport extends Detect implements Criterion, Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -3201017552089221423L;

	public CriterionSupport() {

	}

	public Criterion and(Criterion criterion) {
		return Restrictions.and(this, criterion);
	}

	public Criterion or(Criterion criterion) {
		return Restrictions.or(this, criterion);
	}

	protected List<Entry<String, Object>> safeNamedValue(List<Entry<String, Object>> namedValue) {
		if (null == namedValue)
			namedValue = new ArrayList<Entry<String, Object>>();
		return namedValue;
	}

	// public String toSqlString(String alias, QueryCriteria queryCriteria) {
	// return this.toSqlString(null, queryCriteria);
	// }

}
